/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.io.File;
import java.io.IOException;

/**
 * <p>Project: javase - File2
 * <p>Powered by webrx On 2021-12-14 09:17:24
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class File2 {
    public static void main(String[] args) {
        for (int i = 0; i < 10; i++) {
            File f = new File(String.format("file%02d.txt", i + 1));
            if (f.exists()) {
                f.deleteOnExit();
            } else {
                try {
                    //建立空文本文件
                    f.createNewFile();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
